Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add short option fix for #3798, fix bug in test/SCONSFLAGS.py, fix space issue from #3436 #3799

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

DeeeeLAN
Copy link

@DeeeeLAN DeeeeLAN commented Sep 19, 2020

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt (and read the README.rst)
  • I have updated the appropriate documentation
    • I don't think any documentation updates are necessary in this case.

Fixes issue #3798
Fixes issue #3436

@DeeeeLAN DeeeeLAN changed the title Add short option fix for #3798, fix bug in test/SCONSFLAGS.py Add short option fix for #3798, fix bug in test/SCONSFLAGS.py, fix space issue from #3436 Sep 19, 2020
@mwichmann
Copy link
Collaborator

mwichmann commented Sep 20, 2020

This is nice work, got a lot further than my attempts to dig at this. Haven't had time to deep dive and/or think about the fiddling with SCons variables, but the evidence from the tests is promising. If this does go forward, someone will have to undo some of the doc warnings that were recently added to "don't do that" (nargs > 1, space separators). Also we should hunt down and tie in all the github issues that mention this problem, there are quite a few - at least the ones noted in #3436, there may be others too.

Dillan Mills added 4 commits September 20, 2020 15:02
@bdbaddog
Copy link
Contributor

Looks like test: test/AddOption/args-and-targets.py is failing?
Can you take a look and resolve?

@mwichmann
Copy link
Collaborator

So this test line:

test.run('-Q -q -x A TARG1', status=1, stdout="A\n\\['TARG1'\\]\n")

seems to indicate A is showing up in the targets at the point the SConstruct checks for it after all (one of the old problems this is trying to address), because if it does, then B is added to targets and the result indicates that's being seen:

STDOUT =========================================================================
2c2
< \['TARG1'\]
---
> ['TARG1', 'B']

@mwichmann mwichmann added the args_and_options options processing, arguments, get/setoption and their relationshiop label Mar 22, 2021
@mwichmann
Copy link
Collaborator

This ended up sitting for a long time. @bdbaddog - in terms of at least fixing #3798, would it be more palatable to pick just that part of this PR and submit it separately? The absence of an overridden process_short_options that understands we may not yet have seen the definition of the short option is clearly an omission - though we could also document that it just doesn't work, as came up in the issue. Right now,

AddOption(
    "-F",
    "--force",
    action="store_true",
    help="force installation (overwrite any existing files)",
)

Would fail with a "no such option", if you scons -F

@bdbaddog
Copy link
Contributor

bdbaddog commented Aug 4, 2024

This ended up sitting for a long time. @bdbaddog - in terms of at least fixing #3798, would it be more palatable to pick just that part of this PR and submit it separately?

yes.
So a part which is a partial fix and no downsides?

@mwichmann
Copy link
Collaborator

this is attacking two problems: single-char args, and the problem with args-with-options using space(s); figured it would be easier to get you happy with one at a time?

mwichmann added a commit to mwichmann/scons that referenced this pull request Sep 16, 2024
Override the _process_short_opts method from optparse so it behaves
better.  This fix is lifted directly from SCons#3799, leaving an additional
part to apply later.

Fixes SCons#3798

Signed-off-by: Mats Wichmann <[email protected]>
@mwichmann mwichmann mentioned this pull request Sep 16, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
args_and_options options processing, arguments, get/setoption and their relationshiop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants